package dubbo.learning.sc.sample.consumer.service;

import dubbo.learning.sample.api.action.TestAction;
import dubbo.learning.sample.api.service.TestService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目名称：dubbo-learning
 * 类名称：SpringCloudDubboSampleConsumerApplication
 * 类描述：SpringCloudDubboSampleConsumerApplication
 * 创建时间：2021/6/21
 *
 * @author sisyphus   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
@RestController
@SpringBootApplication
public class SpringCloudDubboSampleConsumerApplication implements CommandLineRunner {

    @Reference
    private TestService testService;

    public static void main(String[] args) {
        SpringApplication.run(SpringCloudDubboSampleConsumerApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        TestAction testAction = new TestAction();
        testAction.setStr("fcvguhbjknlk");

        String s = testService.create(testAction);
        System.out.println(s);
    }
}